package com.sxkf.template.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 订单表
 */
@ApiModel(description = "订单表")
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "t_order")
public class Order {
    /**
     * 订单表PK
     */
    @TableId(value = "id")
    @ApiModelProperty(value = "订单表PK",hidden = true)
    private String id;

    //todo
    private String storeId;

    /**
     * 订单编号
     */
    @TableField(value = "order_no")
    @ApiModelProperty(value = "订单编号")
    private String orderNo;

    @ApiModelProperty(value = "地址id")
    @TableField("address_id")
    private String addressId;

    /**
     * 用户表PK
     */
    @TableField(value = "user_id")
    @ApiModelProperty(value = "用户表PK")
    private String userId;


    @TableField(value = "state")
    @ApiModelProperty(value = "订单状态（）",hidden = true)
    private String state;

    /**
     * 服务，0为赠运费险
     */
    @TableField(value = "serve")
    @ApiModelProperty(value = "服务，0为赠运费险")
    private String serve;

    /**
     * 配送
     */
    @TableField(value = "delivery")
    @ApiModelProperty(value = "配送")
    private String delivery;

    /**
     * 商品总价格
     */
    @TableField(value = "product_total_price")
    @ApiModelProperty(value = "商品总价格")
    private BigDecimal productTotalPrice;

    /**
     * 商品总数量
     */
    @TableField(value = "product_total")
    @ApiModelProperty(value = "商品总数量")
    private Integer productTotal;

    /**
     * 用户优惠券表PK（0=不使用）
     */
    @TableField(value = "user_coupon_id")
    @ApiModelProperty(value = "用户优惠券表PK（不使用则不传）")
    private String userCouponId;

    /**
     * 优惠金额
     */
    @TableField(value = "discount_price")
    @ApiModelProperty(value = "优惠金额")
    private BigDecimal discountPrice;

    /**
     * 运费
     */
    @TableField(value = "freight")
    @ApiModelProperty(value = "运费")
    private BigDecimal freight;

    /**
     * 订单总价格
     */
    @TableField(value = "order_total_price")
    @ApiModelProperty(value = "订单总价格")
    private BigDecimal orderTotalPrice;

    /**
     * 订单支付时间
     */
    @TableField(value = "pay_time")
    @ApiModelProperty(value = "订单支付时间",hidden = true)
    private Date payTime;

    /**
     * 支付金额
     */
    @TableField(value = "pay_price")
    @ApiModelProperty(value = "支付金额")
    private BigDecimal payPrice;

    /**
     * 支付方式（APP=微信app支付，JSAPI=微信小程序支付，ZFB=支付宝支付）
     */
    @TableField(value = "pay_type")
    @ApiModelProperty(value = "支付方式（WX=微信app支付，ZFB=支付宝支付）")
    private String payType;

    /**
     * 备注留言
     */
    @TableField(value = "remark")
    @ApiModelProperty(value = "备注留言")
    private String remark;

    @ApiModelProperty(value = "订单类型（0=普通订单，1=拼团订单）")
    @TableField("order_type")
    private String orderType;

    @ApiModelProperty(value = "拼团id，如果为开团则传0")
    private String spellOutId;

    @TableField(value = "express")
    @ApiModelProperty("物流公司")
    private String express;

    @TableField(value = "express_no")
    @ApiModelProperty("快递单号")
    private String expressNo;


    /**
     * 是否删除(0=否，1=是)
     */
    @TableField(value = "is_delete")
    @ApiModelProperty(value = "是否删除(0=否，1=是)")
    private String isDelete;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间",hidden = true)
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(value = "更新时间",hidden = true)
    private Date updateTime;
    /**
     * 订单商品详情
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "订单商品详情")
    private List<OrderDetail> orderDetails;
    /**
     * 订单收货人地址
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "订单地址详情")
    private OrderRecipient orderRecipient;

//    @TableField(exist = false)
//    @ApiModelProperty(value = "店铺信息")
//    private Store store;


    @TableField(exist = false)
    @ApiModelProperty(value = "店铺名称")
    private String storeName;

    @TableField(exist = false)
    @ApiModelProperty(value = "店铺信息")
    private String storeAvatar;

    @TableField(exist = false)
    @ApiModelProperty(value = "参团人头像")
    private List<String> spellOutAvatar;

    @ApiModelProperty("状态(0=未拼成，1=已拼成，2=已过期)")
    @TableField(exist = false)
    private String spellOutState;

    @ApiModelProperty("剩余时间 毫秒")
    @TableField(exist = false)
    private Long lastTime;

    @ApiModelProperty("售后订单表")
    @TableField(exist = false)
    private AfterSaleOrder afterSaleOrder;



}
